<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
use think\Session;
class Place extends Controller{
    /****
     * Class register          	分销规则
     * @$integral[int]   		钱数或积分
     * @date                	2020/05/20 
     * @package application\index\controller\Place
    */
    public function index(){
        $oneself_id = 34;
        $relation = Db::name('relation')
         			->where(['oneself_id'=>$oneself_id])
         			->find();
        $statistics = Db::name('statistics')
        			->where(['user_id'=>$relation['superior_id']])
        			->find();
        $distributor = Db::name('distributor')
        			->where(['distributor_id'=>$oneself_id])
        			->find();
        if($distributor){
        	
        }
        $statistics_stair = Db::name('relation')
        			->where(['oneself_id'=>$relation['superior_id']])
        			->find();
        $distributor_stair = Db::name('distributor')
        			->where(['distributor_id'=>$statistics_stair['superior_id']])
        			->find();
    	if($distributor_stair){
    		
    	}
    	$statistics_good = Db::name('relation')
    			->where(['oneself_id'=>$distributor_stair['superior_id']])
    			->find();
    	$distributor_good = Db::name('distributor')
    			->where(['distributor_id'=>$statistics_good['superior_id']])
    			->find();
    		if(!$distributor_good){
    			$arr = [
	               'state'     => 0,
	               'message'  => "不分"
	            ];
        		return json($arr);
    		}

    }



    
}
